import ExaminationItem from './ExaminationItem';
import OStyle from './index.less';

enum EIndex {
  '一、' = 1,
  '二、' = 2,
  '三、' = 3,
}

function TestPaperItem(props: { index: number; name: string; score: number; questions: any[] }) {
  const { name, score, questions, index } = props;
  return (
    <div className={OStyle.test_paper_item}>
      <div className={OStyle.item_header}>
        <p className={OStyle.header_name}>
          {EIndex[index + 1]} {name}
        </p>
        <p className={OStyle.header_score}>
          (共{questions.length}，每题{score}分)
        </p>
      </div>
      <div className={OStyle.item_exa_list}>
        {questions.map((queItem: any, queIndex: number) => (
          <ExaminationItem key={queIndex} queIndex={queIndex} queItem={queItem} />
        ))}
      </div>
    </div>
  );
}

export default TestPaperItem;
